<?php

abstract class Base_Loader_Autoload
{

    public static function factory($module)
    {
        if (!Zend_Controller_Front::getInstance()
            ->getDispatcher()->isValidModule($module)) {
            return false;
        }
        
		$resourceAutoloader = new Zend_Loader_Autoloader_Resource(array(
				'basePath'  => MODULES_PATH .'/'. $module,
				'namespace' => '',
			));
        $resourceAutoloader->addResourceTypes(array(
            'block'   => array(
                'namespace' => 'Block',
                'path'      => 'blocks',
            ),
            'form'    => array(
                'namespace' => 'Form',
                'path'      => 'forms',
            ),
            'model'   => array(
                'namespace' => 'Model',
                'path'      => 'models',
            ),
            'table'   => array(
                'namespace' => 'Table',
                'path'      => 'tables',
            ),
            'viewhelper' => array(
                'namespace' => 'View_Helper',
                'path'      => 'views/helpers',
            ),
            'viewfilter' => array(
                'namespace' => 'View_Filter',
                'path'      => 'views/filters',
            ),
        ));
        $resourceAutoloader->setDefaultResourceType('model');
    }
}